//    Copyright (C) Kherty.  All rights reserved.
namespace OpenLS.Spreadsheet.Extensibility
{
    public class IgnoreStringsAttribute : ParameterConverterAttribute
    {
        public IgnoreStringsAttribute()
        {

        }
        public IgnoreStringsAttribute(ReferenceOption refMode)
            : base(refMode)
        {
        }
        internal override void ConvertImp(ConversionData data)
        {
            data.Ignore = data.Value is string;
        }

    }
    public class IgnoreEmptyStringsAttribute : ParameterConverterAttribute
    {
        public IgnoreEmptyStringsAttribute()
        {

        }
        public IgnoreEmptyStringsAttribute(ReferenceOption refMode)
            : base(refMode)
        {
        }
        public override int Priority
        {
            get
            {
                return 1;
            }
        }
        internal override void ConvertImp(ConversionData data)
        {
            if (data.Value is string && ((string)data.Value).Length == 0)
            {
                data.Ignore = true;
            }
        }

    }
}